np.random.seed(2002)S, r, v, q, T, n_reps, n_steps =40.0, 0.08, 0.30, 0.0, 1.0/3.0, 100_000, 3paths = asset_paths(S, r, v, q, T, n_reps, n_steps)fig, (ax1, ax2) = plt.subplots(2, 1, figsize=(6, 4), sharex=True)ending_values = paths[:, -1] # Last column of each rowpath_averages = np.mean(paths, axis=1) # Average of each row# Plot histogram of ending values in the upper panelsns.histplot(ending_values, kde=True, ax=ax1, color='skyblue')ax1.set_title('Distribution of Ending Values')ax1.set_ylabel('Frequency')# Plot histogram of path averages in the lower panelsns.histplot(path_averages, kde=True, ax=ax2, color='salmon')ax2.set_title('Distribution of Path Averages')ax2.set_xlabel('Value')ax2.set_ylabel('Frequency')# Adjust spacing between subplotsplt.tight_layout()# Show the plotplt.show()
Valuing an Arithmetic Asian Option via Monte Carlo
Section 19.5: Efficient Monte Carlo Valuation
Efficient Monte Carlo Valuation (cont’d)
Control variate method
Estimate the error on each trial by using the price of a related option that does have a pricing formula
Example: use errors from geometric Asian option to correct the estimate for the arithmetic Asian option price
Antithetic variate method
For every draw also obtain the opposite and equally likely realizations to reduce variance of the estimate
Stratified sampling
Treat each number as a random draw from each percentile of the uniform distribution